I got rid of the @{ by duplicating divs inside a range of if conditions, but still have the problem, it it now appears to be a traverse function which is the difference between the ones that work and this one that doesn't work.
I have looked and there seems to be a lot of problems with missing "}" caused by DIV tags, but that still doesn't explain why it worked in 4.7.1 and not in umbraco 6.
With MVC 4 comes razor V2, not present in 4.7, but implemented in later versions of Umbraco, there are very few changes, but if you have an @ inside an @{, other than a property call inside a div, it will break code- You do not have a missing }, what you have is an extra @, which doesn't have a } before it. Can't really explain easily, but that is my best shot.
Umbraco 6 Razor Missing Bracket Issue using a @{ within @helper
I had a razor script which worked in 4.7.1 but claims there is a missing "}" when I save or run the script in 6.0.3
the missing "}" is the end of a @{ all my braces match and worked in 4.7.1
if I don't have the @{ i just get Razor source code displayed this is due to using lots of divs in the razor code.
I can't find any reference to the different interpretation of @{ in Umbraco 6 razor to 4.x razor.
Does anyone know what the differences are?
Hey Lou,
I know there was a breaking change to fit in with MVC, something about there having to be a space where there didn't need to be before.
Rich
I am getting this error;
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
at System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType[T](String virtualPath)
at System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType[T](String virtualPath)
at System.Web.WebPages.WebPageBase.CreateInstanceFromVirtualPath(String virtualPath, IVirtualPathFactory virtualPathFactory)
at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
c:\inetpub\wwwroot\WebConnectB2CssV3\MacroScripts\Videos.cshtml(77): error CS1513: } expected
at System.Web.Compilation.AssemblyBuilder.Compile()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
at System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType[T](String virtualPath)
at System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType[T](String virtualPath)
at System.Web.WebPages.WebPageBase.CreateInstanceFromVirtualPath(String virtualPath, IVirtualPathFactory virtualPathFactory)
at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
at umbraco.macro.loadMacroScript(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
I got rid of the @{ by duplicating divs inside a range of if conditions, but still have the problem, it it now appears to be a traverse function which is the difference between the ones that work and this one that doesn't work.
I have looked and there seems to be a lot of problems with missing "}" caused by DIV tags, but that still doesn't explain why it worked in 4.7.1 and not in umbraco 6.
Hi Lou
With MVC 4 comes razor V2, not present in 4.7, but implemented in later versions of Umbraco, there are very few changes, but if you have an @ inside an @{, other than a property call inside a div, it will break code- You do not have a missing }, what you have is an extra @, which doesn't have a } before it. Can't really explain easily, but that is my best shot.
Post some code and we can have a look.
Regards
Gary
is working on a reply...